<template>
  <div class="app-container">
    <el-form label-width="68px" size="small" :inline="true">

      <el-form-item label="标题">
        <el-input placeholder="请输入标题" clearable>
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain size="small" @click="dialogFormVisible = true, title = '新增'">新增</el-button>
      </el-col>
    </el-row>
    <el-table :data="postList">
      <!-- <el-table-column type="selection" width="55" align="center" /> -->

      <el-table-column label="标题" align="center" prop="biaoti" />
      <el-table-column label="作者" align="center" prop="zuozhe" />
      <el-table-column label="更新时间" align="center" prop="shijian" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="toView(scope.row)">修改</el-button>
          <!-- 删除 -->
          <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" /> -->
    <el-dialog :title="title" :visible.sync="dialogFormVisible">
      <el-form label-width="68px" size="small">

        <el-form-item label="标题">
          <el-input placeholder="请输入标题" clearable></el-input>
        </el-form-item>
        <el-form-item label="作者">
          <el-input placeholder="请输入作者" clearable></el-input>
        </el-form-item>
        <el-form-item label="图片">
          <!-- 图片上传 -->

        </el-form-item>
        <!-- 富文本 -->
        <el-form-item label="内容">

        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align: center;">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitForm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>

export default {
  data() {
    return {
      title: "",
      dialogFormVisible: false,
      postList: [
        {
          menu: '首页',
          shijian: '2024-1-22',
          biaoti: '安塞',
          zuozhe: '老墨',
        },
        {
          menu: '重大新闻',
          biaoti: '安塞',
          zuozhe: '老墨',
          shijian: '2024-1-22',
        }
      ]
    }
  },
  methods: {
    // 修改
    toView() {
      this.dialogFormVisible = true
      this.title = '修改'
    }
  }
}
</script>
<style scoped>
::v-deep .el-form-item--small .el-form-item__label {
  text-align: justify;
}
</style>
